import axios from 'axios'
import { baseUrl } from './config'

export default (url,data,succ) => {
    url = baseUrl + url;
    data = data || {};
    axios.get(url, {
        params: data
    }).then(res=> {
        if (res.data.status === 0) {
            succ(res.data.data);
        } else {
            alert(res.data.msg);
        }
    }).catch(()=> {
        alert('网络异常');
    })
}

